package mythread.demo001;

public class MyThread16_3Test extends Thread {

    public static void main(String[] args) {
        //yield 放弃当前资源：不确定什么时候
        //优先级可以继承,优先级有规则性质-大部分先执行
        //5 55 5
        //Thread.currentThread().setPriority(6);//5 6 6 6

        MyThread16_3A myThread = new MyThread16_3A();
        myThread.setPriority(5);
        myThread.start();

        MyThread16_3B myThreadb = new MyThread16_3B();
        myThreadb.setPriority(6);
        myThreadb.start();

        try {
            Thread.sleep(20000);
            myThread.stop();
            myThreadb.stop();


            System.out.println("a="+myThread.getCc());
            System.out.println("b="+myThreadb.getCc());
        } catch (InterruptedException e) {
            e.printStackTrace();
        }


    }
}
